package com.gxa.admin.recycling.service.impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.gxa.admin.recycling.mapper.RoleMapper;
import com.gxa.admin.recycling.service.RoleService;
import com.gxa.core.recycling.pojo.Role;
import com.gxa.core.recycling.service.impl.BaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author R
 * @data 2021-12-02 16:41
 */
@Service
public class RoleServiceImpl extends BaseServiceImpl<Role> implements RoleService {


    @Autowired
    RoleMapper mapper;

    @Override
    public PageInfo<Role> selectAllByPage(Integer page, Integer size) {
        PageHelper.startPage(page, size);
        List<Role> roles = mapper.selectAll();
        PageInfo<Role> of = PageInfo.of(roles);
        return of;
    }
}
